-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DEV-489: Refactor contributor dashboard to use react-query, hide deleted contribs locally #799
Conversation
c4614c4
to
ede8f04
Compare
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
spa/src/components/contributor/contributorDashboard/ContributionPaymentMethod.tsx
Show resolved
Hide resolved
spa/src/components/contributor/contributorDashboard/ContributionPaymentMethod.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great Chris. Lot's of structure changes and I liked them 👍
spa/src/components/contributor/contributorDashboard/ContributionsTable.test.tsx
Show resolved
Hide resolved
ede8f04
to
eb30e43
Compare
eb30e43
to
60be657
Compare
spa/src/components/contributor/contributorDashboard/CancelRecurringButton.test.tsx
Show resolved
Hide resolved
spa/src/components/contributor/contributorDashboard/ContributionsTable.tsx
Show resolved
Hide resolved
hide deleted contribs locally
48d91a9
to
7196f6b
Compare
Please fill out each section even if it's just with "N/A"
Plan? (if this draft/incomplete indicate what you intend to do and how)
n/a
What's this PR do?
User-facing:
This changes the contributor dashboard so that if you successfully cancel a subscription, that subscription will disappear from the table. However, this update is only temporary. Refreshing the browser or otherwise causing data to be fetched from the API will cause it to reappear. This is a limitation of what we can do with the SPA, since we don't have backend changes yet to support it updating during a user session.
The contribution list is no longer sortable, because it didn't work correctly in the first place (see DEV-2152) and clicking to sort too often caused errors. I'd like to bring that back in a separate story since the PR is big as it is.
Behind the scenes:
This is a refactor of the contributor dashboard because most of the existing components expected to be given an Axios request that resolved to data. This was replaced with a hook, useContributorContributionList. The name is because an admin will get a different set of data fields.
Why are we doing this? How does it help us?
This improves UX around cancelling a subscription and makes progress toward unifying our code around using react-query for data retrieval.
How should this be manually tested? Please include detailed step-by-step instructions.
To test the change:
To test regressions (important, because this changes a lot about how the contributor dashboard works behind the scenes):
Did this PR make changes to the user interface that may require changes to the user-facing docs?
It removed the sortable table header in the contributor dashboard temporarily.
Have automated unit tests been added? If not, why?
Yes.
How should this change be communicated to end users?
We might want to explain that sorting the table will return.
Are there any smells or added technical debt to note?
Maintaining local state is not great, but it seems like the best we can do until backend changes happen.
Has this been documented? If so, where?
No.
What are the relevant tickets? Add a link to any relevant ones.
https://news-revenue-hub.atlassian.net/browse/DEV-489
Do any changes need to be made before deployment to production (adding environment variables, for example)?
No.
Are there next steps? If so, what? Have tickets been opened for them? List next-step tickets here:
https://news-revenue-hub.atlassian.net/browse/DEV-2152